- /* sdfasinh.cpp by K.Tsuru */
- // function ID 3310 DRADIX
- /***************************************************************
- SDouble class
- inverse hyperbolic function arsinh(x)(area sinh)
- [Definition]
- r = sqrt(x*x+1)
- x > 0 : arsinh(x)= log(r + x)
- x < 0 : arsinh(x)= -log(r - x)
- If |x| is much less than one,the addition x to r(very close to one)
- causes a loss of trailing digits.Then a formula
- arsinh x = artanh( x/sqrt(x^2+1) )
- is used.The series is used to evaluate "artanh".
- ****************************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SDouble Asinh(const SDouble& x){
- if(x.Sign(3310) == 0) return 0.0;
- SDouble r, y, one(1.0);
-
- if(x.NetRdxExp() < 0){ // |x| < 1/DRADIX
- r = x*RecSqrt(x*x+one); // r = x/sqrt(x*x+1)
- y = AtanhSeries(r); // Asinh(x) = Atanh( x/sqrt(x*x+1) )
- } else {
- r = Sqrt(x*x+one);
- if(x.Sign() > 0) r = r + x;
- else r = r - x;
- y = Log(r);
- if(x.Sign() < 0) y.ChangeSign(); // r = -r;
- }
- return y;
- }
sdfasinh.cpp : last modifiled at 2015/12/03 21:31:49(1,031 bytes)
created at 2017/10/07 10:22:50
The creation time of this html file is 2017/10/07 11:29:39 (Sat Oct 07 11:29:39 2017).